.class public Lcom/glympse/android/glympse/DlgSendComplete;
.super Lcom/glympse/android/glympse/DlgList;
.source "DlgSendComplete.java"

# interfaces
.implements Lcom/glympse/android/glympse/DlgShell$DlgShellListener;
.implements Lcom/glympse/platform/common/GlympseListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;
    }
.end annotation


# instance fields
.field protected m_listRecipients:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/glympse/platform/common/Recipient;",
            ">;"
        }
    .end annotation
.end field

.field protected m_nSkipRecipients:I

.field protected m_oRecipientAdapter:Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;

.field protected m_oTicket:Lcom/glympse/platform/common/Ticket;


# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/glympse/platform/common/Ticket;I)V
    .locals 2
    .parameter "oContext"
    .parameter "oTicket"
    .parameter "nSkipRecipients"

    .prologue
    const/4 v1, 0x0

    .line 45
    invoke-direct {p0, p1, v1}, Lcom/glympse/android/glympse/DlgList;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 37
    iput-object v1, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    .line 38
    const/4 v0, 0x0

    iput v0, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_nSkipRecipients:I

    .line 39
    iput-object v1, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oRecipientAdapter:Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;

    .line 40
    iput-object v1, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_listRecipients:Ljava/util/ArrayList;

    .line 47
    const v0, 0x7f02004d

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgSendComplete;->SetTitleIcon(I)V

    .line 48
    iget-object v0, p2, Lcom/glympse/platform/common/Ticket;->m_listRecipients:Lcom/glympse/platform/GVector$Recipients;

    invoke-virtual {v0}, Lcom/glympse/platform/GVector$Recipients;->size()I

    move-result v0

    if-le v0, p3, :cond_0

    .line 49
    const v0, 0x7f0a0044

    .line 48
    :goto_0
    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgSendComplete;->SetTitleText(I)V

    .line 51
    iput-object p2, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    .line 52
    iput p3, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_nSkipRecipients:I

    .line 53
    return-void

    .line 49
    :cond_0
    const v0, 0x7f0a0045

    goto :goto_0
.end method


# virtual methods
.method public DoUpdate(I)V
    .locals 7
    .parameter "nUpdateFlags"

    .prologue
    const/4 v6, 0x4

    .line 123
    and-int/lit16 v3, p1, 0x1010

    if-nez v3, :cond_0

    .line 155
    :goto_0
    return-void

    .line 129
    :cond_0
    const/4 v0, 0x1

    .local v0, fComplete:Z
    const/4 v1, 0x0

    .line 130
    .local v1, fFailed:Z
    iget-object v3, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_listRecipients:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_1
    :goto_1
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_3

    .line 148
    if-eqz v0, :cond_2

    .line 150
    if-eqz v1, :cond_5

    const v3, 0x7f0a0047

    :goto_2
    invoke-virtual {p0, v3}, Lcom/glympse/android/glympse/DlgSendComplete;->SetTitleText(I)V

    .line 154
    :cond_2
    iget-object v3, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oRecipientAdapter:Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;

    invoke-virtual {v3}, Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;->notifyDataSetChanged()V

    goto :goto_0

    .line 130
    :cond_3
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/glympse/platform/common/Recipient;

    .line 133
    .local v2, oRecipient:Lcom/glympse/platform/common/Recipient;
    iget v4, v2, Lcom/glympse/platform/common/Recipient;->m_eSendState:I

    if-ne v6, v4, :cond_4

    .line 135
    const/4 v1, 0x1

    .line 140
    :cond_4
    iget v4, v2, Lcom/glympse/platform/common/Recipient;->m_eSendState:I

    if-eq v6, v4, :cond_1

    .line 141
    const/4 v4, 0x5

    iget v5, v2, Lcom/glympse/platform/common/Recipient;->m_eSendState:I

    if-eq v4, v5, :cond_1

    .line 143
    const/4 v0, 0x0

    goto :goto_1

    .line 150
    .end local v2           #oRecipient:Lcom/glympse/platform/common/Recipient;
    :cond_5
    const v3, 0x7f0a0046

    goto :goto_2
.end method

.method public OnCancel(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 1
    .parameter "oDlgShell"

    .prologue
    .line 169
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    .line 170
    return-void
.end method

.method public OnDismissed(Lcom/glympse/android/glympse/DlgShell;Z)V
    .locals 0
    .parameter "oDlgShell"
    .parameter "fOk"

    .prologue
    .line 175
    return-void
.end method

.method public OnOk(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 5
    .parameter "oDlgShell"

    .prologue
    .line 160
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    if-eqz v0, :cond_0

    .line 162
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    new-instance v1, Lcom/glympse/android/glympse/DlgSaveFavorite;

    sget-object v2, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v3, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    const/4 v4, 0x0

    invoke-direct {v1, v2, v3, v4}, Lcom/glympse/android/glympse/DlgSaveFavorite;-><init>(Landroid/content/Context;Lcom/glympse/platform/common/Ticket;Lcom/glympse/android/glympse/DlgShell$DlgShellListener;)V

    invoke-virtual {v0, v1}, Lcom/glympse/android/glympse/Glympse;->QueueDialog(Landroid/app/Dialog;)Z

    .line 164
    :cond_0
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 5
    .parameter "savedInstanceState"

    .prologue
    .line 71
    iget-object v2, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    iget-object v2, v2, Lcom/glympse/platform/common/Ticket;->m_listRecipients:Lcom/glympse/platform/GVector$Recipients;

    invoke-virtual {v2}, Lcom/glympse/platform/GVector$Recipients;->size()I

    move-result v2

    iget v3, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_nSkipRecipients:I

    sub-int v1, v2, v3

    .line 72
    .local v1, nCount:I
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2, v1}, Ljava/util/ArrayList;-><init>(I)V

    iput-object v2, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_listRecipients:Ljava/util/ArrayList;

    .line 73
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    if-lt v0, v1, :cond_1

    .line 82
    new-instance v2, Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;

    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgSendComplete;->getContext()Landroid/content/Context;

    move-result-object v3

    iget-object v4, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_listRecipients:Ljava/util/ArrayList;

    invoke-direct {v2, p0, v3, v4}, Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;-><init>(Lcom/glympse/android/glympse/DlgSendComplete;Landroid/content/Context;Ljava/util/List;)V

    iput-object v2, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oRecipientAdapter:Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;

    .line 83
    iget-object v2, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oRecipientAdapter:Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;

    const/4 v3, 0x0

    const/4 v4, 0x0

    invoke-virtual {p0, v2, v3, v4}, Lcom/glympse/android/glympse/DlgSendComplete;->SetListAdapter(Landroid/widget/ListAdapter;Landroid/widget/AdapterView$OnItemClickListener;Z)Landroid/widget/ListView;

    .line 84
    invoke-virtual {p0, p0}, Lcom/glympse/android/glympse/DlgSendComplete;->SetDlgShellListener(Lcom/glympse/android/glympse/DlgShell$DlgShellListener;)V

    .line 87
    const v2, 0x7f0a005a

    invoke-virtual {p0, v2}, Lcom/glympse/android/glympse/DlgSendComplete;->SetCancelText(I)V

    .line 88
    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgSendComplete;->GetCancelButton()Landroid/widget/Button;

    move-result-object v2

    invoke-virtual {v2}, Landroid/widget/Button;->requestFocus()Z

    .line 91
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    invoke-virtual {v2, p0}, Lcom/glympse/platform/Platform;->AddGlympseListener(Lcom/glympse/platform/common/GlympseListener;)V

    .line 95
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    iget-object v2, v2, Lcom/glympse/platform/Platform;->m_oFavoriteList:Lcom/glympse/platform/common/FavoriteList;

    iget-object v3, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    invoke-virtual {v2, v3}, Lcom/glympse/platform/common/FavoriteList;->FindMatch(Lcom/glympse/platform/common/Ticket;)Lcom/glympse/platform/common/Ticket;

    move-result-object v2

    if-nez v2, :cond_0

    .line 97
    const v2, 0x7f0a004b

    invoke-virtual {p0, v2}, Lcom/glympse/android/glympse/DlgSendComplete;->SetOkText(I)V

    .line 100
    :cond_0
    const/high16 v2, 0x4000

    invoke-virtual {p0, v2}, Lcom/glympse/android/glympse/DlgSendComplete;->DoUpdate(I)V

    .line 102
    invoke-super {p0, p1}, Lcom/glympse/android/glympse/DlgList;->onCreate(Landroid/os/Bundle;)V

    .line 103
    return-void

    .line 75
    :cond_1
    iget-object v3, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_listRecipients:Ljava/util/ArrayList;

    iget-object v2, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oTicket:Lcom/glympse/platform/common/Ticket;

    iget-object v2, v2, Lcom/glympse/platform/common/Ticket;->m_listRecipients:Lcom/glympse/platform/GVector$Recipients;

    iget v4, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_nSkipRecipients:I

    add-int/2addr v4, v0

    invoke-virtual {v2, v4}, Lcom/glympse/platform/GVector$Recipients;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/glympse/platform/common/Recipient;

    invoke-virtual {v3, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 73
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method protected onDestroy()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 109
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    invoke-virtual {v0, p0}, Lcom/glympse/platform/Platform;->RemoveGlympseListener(Lcom/glympse/platform/common/GlympseListener;)V

    .line 111
    iput-object v1, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_oRecipientAdapter:Lcom/glympse/android/glympse/DlgSendComplete$RecipientAdapter;

    .line 112
    iput-object v1, p0, Lcom/glympse/android/glympse/DlgSendComplete;->m_listRecipients:Ljava/util/ArrayList;

    .line 114
    invoke-super {p0}, Lcom/glympse/android/glympse/DlgList;->onDestroy()V

    .line 115
    return-void
.end method
